package research.toe.duangjarern;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;

/**
 * Created by nipitponmuensan on 3/5/15 AD.
 */
public class QuestionTypeTwoFragment extends Fragment {

    private static final String ARG_SECTION_NUMBER = "section_number";

    /**
     * Returns a new instance of this fragment for the given section
     * number.
     */
    public static QuestionTypeTwoFragment newInstance(int sectionNumber) {
        QuestionTypeTwoFragment fragment = new QuestionTypeTwoFragment();
        Bundle args = new Bundle();
        args.putInt(ARG_SECTION_NUMBER, sectionNumber);
        fragment.setArguments(args);
        return fragment;
    }


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View rootView = inflater.inflate(R.layout.quest_type_two , container, false);
        int PageIndex = getArguments().getInt("Page");

        Button btnSendAnswer = (Button)rootView.findViewById(R.id.btnSendAnswer);

        if(PageIndex != 10){
            btnSendAnswer.setVisibility(View.GONE);
        }
        else{
            btnSendAnswer.setVisibility(View.VISIBLE);
        }

        TextView txtPageNumber = (TextView)rootView.findViewById(R.id.txtPageNumber);
        txtPageNumber.setText(String.valueOf(PageIndex)+"/10");


        return rootView;
    }

}
